package com.koala.api;

import com.koala.dto.UserAuthRespVO;
import com.koala.result.Result;
import com.koala.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户模块
 *
 * @author koala
 */
@Slf4j
@RestController
@RequestMapping("/v1/user")
public class SysUserApi {

    @Autowired
    private SysUserService userService;

    @GetMapping("/username/{username}")
    public Result<UserAuthRespVO> getAuthInfoByUsername(@PathVariable String username) {
        UserAuthRespVO user = userService.getAuthInfoByUsername(username);
        return Result.success(user);
    }
}
